package com.fili;

import com.fili.gui.MainFrame;
import com.fili.core.Parser;
import com.fili.core.ParserException;

import javax.swing.*;

/**
 * Created by Claudiu-Florin FILIMON
 * Date: Oct 5, 2006
 * Time: 12:37:54 PM
 * Revision: 0
 */
public class MegaBuildMain
{
    public static void main(String[] args)
    {
        if (args.length != 1)
        {
            System.out.println("Please specify script name");
            return;
        }
        try
        {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }


        Parser p = new Parser();

        try
        {
            if (p.parseFile(args[0]))
                new MainFrame(p.getBatchJob());
        }
        catch (Exception e)
        {
            if (e instanceof ParserException)
                System.out.println(e.getMessage());
            else
                e.printStackTrace();
        }
    }
}
